package com.example.smartlearning.controller;

import com.example.smartlearning.service.impl.BookServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@CrossOrigin//跨域
@RestController//遵循RestFul
@RequestMapping("/Smart/Book/")
public class BookController {
    @Resource
    BookServiceImpl bookService;

    /**
     * 根据id查询书籍
     *
     * @param bookId bookId
     * @return 返回
     */
    @GetMapping("selectBookById")
    private String selectBookById(@RequestParam("bookId") int bookId) {
        return bookService.selectBookById(bookId);
    }

    /**
     * 根据id查询书籍的内容
     *
     * @param bookId bookId
     * @return 返回
     */
    @GetMapping("selectAllByContent")
    private String selectAllByContent(@RequestParam("bookId") int bookId) {
        return bookService.selectAllByContent(bookId);
    }
}
